//
//  PaySuccessPage_Vc.swift
//  Pods
//
//  Created by eme on 2017/4/5.
//
//


/*
 owner:cy
 update:2017年01月17日17:43:56
 info: 测试界面
 */
import RxSwift
import UtilCore

class PaySuccessPage_Vc: Base_Vc {
    
    /****************************Storyboard UI设置区域****************************/
    @IBOutlet weak var show_Desc_Lb: UILabel!
    @IBOutlet weak var pay_ImgV: UIImageView!
    
    /// 1：支付成功 2:支付失败 3:取消支付
    var showType:String?
    
    /*----------------------------   自定义属性区域    ----------------------------*/
    
    
    /****************************Storyboard 绑定方法区域****************************/
    
    
    
    /**************************** 以下是方法区域 ****************************/
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        
    }
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        
    }
    /**
     界面基础设置
     */
    override func setupUI() {
        /**
         *  自定义 导航栏左侧 返回按钮
         */
        self.customLeftBarButtonItem()
        if let showtype = self.showType {
            switch showtype {
            case "1":
                self.pay_ImgV.image = UIImage(named: "paysuccessimg")
                self.show_Desc_Lb.text = "您已支付成功！"
            case "2":
                self.pay_ImgV.image = UIImage(named: "payfailedimg")
                self.show_Desc_Lb.text = "支付失败！"
            case "3":
                self.pay_ImgV.image = UIImage(named: "paycancleimg")
                self.show_Desc_Lb.text = "您已取消支付！"
            default:
                self.pay_ImgV.image = UIImage(named: "paysuccessimg")
                self.show_Desc_Lb.text = "您已支付成功！"
            }
        }
    }
    /**
     自定义返回上级界面
     */
    override func backToView()  {
        let rootsVc = self.navigationController?.viewControllers
        let count = rootsVc?.count
        if let count = count {
            if count == 4 {
                _ =  self.navigationController?.popToViewController(rootsVc![count - 3], animated: true)
            }else{
                _ =  self.navigationController?.popToViewController(rootsVc![count - 4], animated: true)
            }
        }else{
            _ =  self.navigationController?.popViewController(animated: true)
        }
    }
    /**
     app 主题 设置
     */
    override func setViewTheme(){
        
    }
    /**
     绑定到viewmodel 设置
     */
    override func bindToViewModel(){
        
    }
}
